package com.easylinkin.linkappapi.meterbilling.service;

import com.easylinkin.linkappapi.meterbilling.entity.EnergyConsumption;
import com.easylinkin.linkappapi.meterbilling.entity.MeterDeviceConfig;
import com.easylinkin.linkappapi.meterbilling.entity.RoomExpensesBill;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * class info :房间支出service
 *
 * @author liuqihang
 * @date 2021/7/15 14:35
 */
public interface RoomExpensesService {

    void meterTimerTask();

    Object[] deductionBalance(Integer roomId, BigDecimal waterBalance, BigDecimal electricityBalance);

    void saveExpensesBill(RoomExpensesBill roomExpensesBill);

    List<EnergyConsumption> getEnergyConsumptionDateList(Date[] settlementTimePeriod, List<MeterDeviceConfig> list);
    List<EnergyConsumption> getEnergyConsumptionDateListNew(Date[] settlementTimePeriod, List<MeterDeviceConfig> list);

    /**
     * 获取上一次计算区域时间段
     * @return
     */
    Date[] getLastSettlementTimePeriod();

    /**
     * 获取当前需要执行的时间段
     * @return
     */
    Date[] getCurrentSettlementTimePeriod();

    void calculation(EnergyConsumption ec, String operator, Integer remedyStatus);

    Map<String, List<RoomExpensesBill>> getNewestRoomExpensesBillRecordByDeviceCode(List<MeterDeviceConfig> list);
    Map<String, List<RoomExpensesBill>> getNewestRoomExpensesBillRecordByDeviceCode(String deviceCode);
}
